from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template
from django.contrib import admin
import settings

# Uncomment the next two lines to enable the admin:
#from django.contrib import admin
admin.autodiscover()
handler404 = 'sns.views.Error_404'
handler500 = 'sns.views.Error_500'
urlpatterns = patterns('',
    url(r'^js/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_PATH}),
    url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_PATH}),
    # url(r'^media/(?P<path>.*)$','django.views.static.serve',{'document_root':'C:\djangosns\media'}),
    url(r'^$', 'sns.views.index'),
    url(r'^personalIndex/(.+)/$', 'sns.views.personalIndex'),
    url(r'^article/saveComment/', 'sns.views.saveComment'),
    url(r'^article/commentPage/', 'sns.views.commentPage'),
    url(r'^article/ajax/', 'sns.views.getArticle'),
    url(r'^article/personalAjax/(.+)/$', 'sns.views.getPersonalArticle'),
    url(r'^signup/$', 'sns.views.signup'),
    url(r'^login/$', 'sns.views.login_view'),
    url(r'^logout/$', 'sns.views.logout_view'),
    url(r'^forgetPassword/$', 'sns.views.forget_password'),
    url(r'^resetpass/(.+)/$', 'sns.views.begin_reset_password'),
    url(r'^resetpass/(.+)/$', 'sns.views.begin_reset_password'),
    url(r'^newpass/$', 'sns.views.reset_password'),
    url(r'^setting/$', 'sns.views.setting'),
    url(r'^unfollow/(.+)/$', 'sns.views.unfollow'),
    url(r'^follow/(.+)/$', 'sns.views.follow'),
    url(r'^followList/(.+)/$', 'sns.views.followList'),
    url(r'^followerList/(.+)/$', 'sns.views.followerList'),
    url(r'^dm/(.+)/$', 'sns.views.direct_message'),
    url(r'^deldm/(.+)/$', 'sns.views.deldm'),
    url(r'^checkdm/$', 'sns.views.check_dm'),

    url(r'^articleAdd/$', 'sns.views.addArticle'),
    url(r'^articleIndex/$', 'sns.views.articleIndex'),
    url(r'^articlePreview/$', 'sns.views.articlePreview'),
    url(r'^detail/(.+)/$', 'sns.views.article_detail'),
    url(r'^editArticle/$', 'sns.views.editArticle'),
    url(r'^editArticleIndex/(.+)/$', 'sns.views.editArticleIndex'),
    # boardArticle
    url(r'^boardAticleAdd/(.+)/$', 'sns.views.boardAddArticle'),
    url(r'^boardArticleIndex/(.+)/$', 'sns.views.boardArticleIndex'),


    url(r'^upvote/(.+)/$', 'sns.views.up_vote'),
    url(r'^downvote/(.+)/$', 'sns.views.down_vote'),

    # Uncomment the admin/doc line below to enable admin documentation:
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),

    #report
    url(r'^reportMessage/$', 'sns.views.reportMesage'),

    #tinymce
    url(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': './media', 'show_indexes': True}),
    #upladify
    url(r'^uploadIndex/$', 'sns.views.uploadIndex'),
    url(r'^uploadIndex_new/$', 'sns.views.uploadIndex_new'),
    url(r'^upload_script/$', 'sns.views.uploadify_script'),
    url(r'^delete_uploadfile/$', 'sns.views.profile_delte'),
    url(r'^paypalnotify/', include('paypal.standard.ipn.urls')),
    url(r'^ad/', 'sns.views.ad'),
    url(r'^myad/', 'sns.views.myad'),
    url(r'^senior/', 'sns.views.senior'),
    url(r'^applyboard/', 'sns.views.applyboard'),
    url(r'^myboardlist/', 'sns.views.myboardlist'),
    url(r'^viewboard/(.+)/$', 'sns.views.viewboard'),
    url(r'^gift/(.+)/$', 'sns.views.gift'),
    url(r'^contact/$', 'sns.views.contact'),
    url(r'^kickArticle/(.+)/$', 'sns.views.kickArticle'),
    url(r'^kickUser/(.+)/(.+)/$', 'sns.views.kickArticle'),

    # url(r'^test/', 'sns.views.test'),
)
